home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12520 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Looking for semaphore example.
  5. Date: Mon, 01 Apr 96 13:42:29 GMT
  6. Organization: none
  7. Message-ID: <828366149snz@genesis.demon.co.uk>
  8. References: <4jc5hd$1vlv@ilx018.iil.intel.com> <828220289snz@genesis.demon.co.uk> <4jlc0k$j02@solutions.solon.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4jlc0k$j02@solutions.solon.com>
  15.            seebs@solutions.solon.com "Peter Seebach" writes:
  16.  
  17. >In article <828220289snz@genesis.demon.co.uk>,
  18. >Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  19. >>>Hi - 
  20. >>>I'm looking for a simple example of implementation of semaphore in C .
  21. >
  22. >>Not possible - the C language doesn't support semaphores. You'll have
  23. >>to go beyond the C language to get this.
  24. >
  25. >Nonsense!  You'll just need to go beyond the C language to implement
  26. >semaphores in a useful or meaningful way.  :)  You could easily implement
  27. >a semaphore algorithm in C, it just wouldn't matter in pure C, because
  28. >you'd only ever have the one process.
  29.  
  30. In that case it isn't really a semaphore, just a flag that marks a
  31. particular region of execution.
  32.  
  33. >Unless you wanted to implement software-level coprocesses or the like,
  34. >which you could do.
  35.  
  36. Strictly conforming?
  37.  
  38. I will defend my position to the last (and beyond)! :-)
  39.  
  40. -- 
  41. -----------------------------------------
  42. Lawrence Kirby | fred@genesis.demon.co.uk
  43. Wilts, England | 70734.126@compuserve.com
  44. -----------------------------------------
  45.